package com.ziyun.erp.modules.member.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.ziyun.erp.modules.member.dao.UserPointDao;
import com.ziyun.erp.modules.member.entity.UserPointEntity;
import com.ziyun.erp.modules.member.service.UserPointService;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service("userPointService")
public class UserPointServiceImpl extends ServiceImpl<UserPointDao, UserPointEntity> implements UserPointService {

    @Override
    public PageUtils queryPage(Map<String, Object> params, Integer memberId) {
        Page<UserPointEntity> page = this.selectPage(
                new Query<UserPointEntity>(params).getPage(),
                new EntityWrapper<UserPointEntity>().eq("user_id", memberId)
        );

        return new PageUtils(page);
    }

}
